package com.bwf.lgqingdan.gui.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bwf.lgqingdan.R;
import com.bwf.lgqingdan.entity.ResponseHotTags;
import com.bwf.lgqingdan.gui.adapter.base.BaseAdapterViewAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by LG on 2016/11/18.
 * Tips:热门标签 界面中GridView的Adapter
 */

public class HotTagsAdapter extends BaseAdapterViewAdapter<ResponseHotTags.DataBean.SectionsBean.ItemsBean> {
    public HotTagsAdapter(Context context) {
        super(context);
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflaterView(R.layout.list_item_tag_all_hot, parent);
        return new ItemViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        ItemViewHolder viewHolder = (ItemViewHolder) holder;
        viewHolder.tvItemSectionItems.setText(getItem(position).getTitle());
    }

    class ItemViewHolder extends ViewHolder{
        @BindView(R.id.tv_item_section_items)
        TextView tvItemSectionItems;

        ItemViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
